package com.lyl.dubbo.controller;

import com.lyl.dubbo.model.UserAddress;
import com.lyl.dubbo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: LiYunLong
 * Date: 2019/12/26
 * Time: 15:54
 * Description:
 */
@RestController
@RequestMapping("demo")
public class DemoController {

    @Autowired
    private UserService userService;

    @GetMapping(value = "/users")
    public List<UserAddress> userAddresses(){
        return userService.getUserAddressList("");
    }

    @GetMapping("test")
    public String test() {
        return "Hello World!";
    }
}
